//
//  MULXAuthHttpRequest.h
//  UniLoginSDK
//
//  Created by Song Xiaofeng on 13-12-13.
//  Copyright (c) 2013年 Mafengwo Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

static NSString *kHttpGET = @"GET";
static NSString *kHttpPOST = @"POST";

typedef void (^xauthRequestDidCompleteBlock_t)(NSData* responseData, NSDictionary *parsedJson, NSError* error);

@interface MULXAuthHttpRequest : NSObject
{
    NSURL *_requestURL;
}
@property (nonatomic, readonly)NSURL *requestURL;
@property (nonatomic, copy)NSString *HTTPMethod;// GET or POST
@property (nonatomic, copy)xauthRequestDidCompleteBlock_t xauthRequestDidCompleteBlock;

@property (nonatomic, strong)NSMutableDictionary *requestParamerts;// request parameters with string value

+ (MULXAuthHttpRequest *)requestWithURL:(NSURL *)url;
+ (MULXAuthHttpRequest *)requestWithURLString:(NSString *)urlString;
- (MULXAuthHttpRequest *)initWithURL:(NSURL *)theURL;

- (void)startAsynchronous;
- (void)cancel;

+ (NSString*)queryStringOfParameterDic:(NSDictionary*)unencodedDic;
@end
